Skip to content

fix: unify answer recovery states with shared EmptyState#802

Closed
BigSimmo wants to merge 4 commits into
mainfrom
cursor/unify-answer-recovery-db17
Closed

fix: unify answer recovery states with shared EmptyState#802
BigSimmo wants to merge 4 commits into
mainfrom
cursor/unify-answer-recovery-db17

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

  • Hosted Static PR checks / Build / Unit coverage / Advisory UI on predecessor heads.
  • npm run verify:ui evidence via hosted UI gates on predecessor heads.
  • UI verification not run locally in this babysit pass: relying on hosted Production UI.

Risk and rollout

  • Risk: low; presentation-only recovery state unification with no retrieval contract change.
  • Rollback: revert this PR to restore prior inline recovery markup.
  • Provider or production effects: None

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Improved answer recovery screens with clearer empty-state messaging for cancelled requests, no results, and errors.
    • Added contextual actions such as retrying, focusing the question field, and searching documents.
    • Added visual tones for neutral, informational, and error states.
  • Accessibility

    • Improved status and alert announcements so important recovery messages are communicated more effectively.

@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

EmptyState now supports recovery actions, live-region semantics, tone styling, and test IDs. ClinicalDashboard uses it for cancelled, no-results, and error answer states, with tests covering status and alert roles.

Changes

Answer recovery UI

Layer / File(s) Summary
Extend EmptyState contract
src/components/ui-primitives.tsx, tests/ui-primitives.dom.test.tsx
EmptyState supports actions, live-region roles, neutral/info/danger tones, test IDs, and tests for status and alert rendering.
Integrate answer recovery states
src/components/ClinicalDashboard.tsx
Cancelled, no-results, and generic error states render configured EmptyState variants while retaining retry, rephrase, and document-search callbacks.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • BigSimmo/Database#798: Directly overlaps the ClinicalDashboard EmptyState integration and shared component API changes.

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: consolidating answer recovery states into the shared EmptyState component.
Description check ✅ Passed The description covers summary, verification, risk/rollback, and governance preflight; only minor template details like Notes are missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/unify-answer-recovery-db17

Comment @coderabbitai help to get the list of available commands.

@cursor
cursor Bot enabled auto-merge (squash) July 17, 2026 20:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/ClinicalDashboard.tsx`:
- Around line 3648-3655: Update the error EmptyState branch in ClinicalDashboard
to distinguish errors by activeModeResultKind instead of always presenting
“Answer unavailable.” Use the appropriate title and icon for document-search and
clipboard errors, while preserving the answer-specific presentation for answer
errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dc1fddb3-1808-42b7-802d-9563fea5fb17

📥 Commits

Reviewing files that changed from the base of the PR and between 3ff8095 and d7afb2f.

📒 Files selected for processing (3)
  • src/components/ClinicalDashboard.tsx
  • src/components/ui-primitives.tsx
  • tests/ui-primitives.dom.test.tsx

Comment on lines +3648 to +3655
) : error ? (
<EmptyState
icon={CircleAlert}
title="Answer unavailable"
body={error}
live="assertive"
tone="danger"
testId="answer-error"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not label every dashboard error as an answer failure.

This branch also handles document-search and clipboard errors, so those modes now display “Answer unavailable.” Select the title/icon based on activeModeResultKind, or restrict this EmptyState to answer errors.

Proposed fix
-                    title="Answer unavailable"
+                    title={activeModeResultKind === "answer" ? "Answer unavailable" : "Search unavailable"}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
) : error ? (
<EmptyState
icon={CircleAlert}
title="Answer unavailable"
body={error}
live="assertive"
tone="danger"
testId="answer-error"
) : error ? (
<EmptyState
icon={CircleAlert}
title={activeModeResultKind === "answer" ? "Answer unavailable" : "Search unavailable"}
body={error}
live="assertive"
tone="danger"
testId="answer-error"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ClinicalDashboard.tsx` around lines 3648 - 3655, Update the
error EmptyState branch in ClinicalDashboard to distinguish errors by
activeModeResultKind instead of always presenting “Answer unavailable.” Use the
appropriate title and icon for document-search and clipboard errors, while
preserving the answer-specific presentation for answer errors.

@BigSimmo BigSimmo closed this Jul 18, 2026
auto-merge was automatically disabled July 18, 2026 06:23

Pull request was closed

cursor Bot pushed a commit that referenced this pull request Jul 18, 2026
CodeRabbit residual from superseded #802: non-answer modes should not
show "Answer unavailable" for document-search/clipboard failures.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 18, 2026
#812)

* fix: place Also matches after mode hubs and always show error focus

Keep tools/favourites Also matches after primary hub content so the
panel matches the post-results placement landed from the screenshot
queue, and use focus: styles on the route error heading so recovery
focus remains visible after pointer-driven failures.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

* fix: distinguish answer vs search EmptyState error titles

CodeRabbit residual from superseded #802: non-answer modes should not
show "Answer unavailable" for document-search/clipboard failures.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants